Vinicius Guerra e Ribas - Energy Sector Analyst¶

Energy Engineer (UnB) │ Data Scientist and Analytics (USP)

📧 E-mail │ 🎯 Linkedin │ 😸 GitHub¶



🇬🇧 - English

This Jupyter Notebook is a Data Exploration for the purpose of providing the Dashboard Report with the most pertinent information. It first uploads previously treated data and then analyzes it in statistical and visual ways.

This Data Exploration is part of the flow of the Data Engineering Solution developed to present generation data from the Brazilian electricity sector in a dashboard type report, prioritizing being iterative, dynamic and autonomous. Accessible by specialists in a timely manner.

For better understanding, the code has been divided into five parts:

  • Data Load:
    • Here, the load_data() function is created to load the data and present its first information, referring to the DataFrame generation date and updates from the Brazilian Electric Energy Agency server.
    • Also in this section the variables created are classified according to their typology and explained (Metadata).
  • Categorical Variables Analyses:

    • These analyses were critical, since the vast majority of the variables in this DataFrame are categorical.

    • First the unique values of each categorical variable are checked.

    • These values are then analyzed via an alluvial diagram, enabling a hierarchization of the variables.

  • DateTime Analyses:

    • It is known that outliers exist in this data, since in the ETL process null values were replaced by the year "1900".

    • Because of this, the data that does not contain outliers of this type is filtered.

    • Finally, temporal analyses are performed:

      • BOXPLOT: Timeline - Generation Type and Enterprise.
      • HISTOGRAM: Timeline - Phase and Generation Type
      • HEATMAP: Timeline - Type of Generation and Granted Power
  • Categorical & Numerical Variables Analyses:

    • Hierarchical Analyses:

      • IcicleChart: Granted Power by Phase, State and Generation Type in Brazil.
      • SunBurstChart: Granted power by Phase, State and Generation type in Brazil.
      • TreeMapChart: Granted Power by Phase, State and Generation type in Brazil.
    • Analysis between variables:

      • BarChart: Granted Power by State, State of Manufacture and Phase.
      • StripChart: Granted Power by State, Generation Type, Phase and Enterprise.
      • 3D-ScatterPlot: Granted power and physical guarantee by Federal Government, Generation Type, Phase and enterprise.
        • For this analysis only the projects with physical guarantees were considered.
  • Geographical Variables Analyses*:

    • It is known that there are outliers in this data, since in the ETL process null values were replaced by 0.
    • Because of this, the data that do not contain outliers of this type are filtered.
    • Iterative Cartesian Coordinate Map: Granted Power, Generation Type, Enterprise and Phase.

The detailed step-by-step is presented below.



🇧🇷 - Portuguese

Este Jupyter Notebook é uma Exploração de Dados com o foco em subsidiar o *Relatório em Dashboard com as informações mais pertinentes. Primeiro são carregados dados previamente tratados e para depois os analisar de formas estatísticas e visuais.

Esta Exploração de Dados compõe o fluxo da solução em engenharia de dados desenvolvida para apresentar dados de geração do setor elétrico brasileiro em um relatório do tipo dashboard, priorizando ser iterativo, dinâmico e autônomo. Acessível por especialistas de forma tempestiva.

Para melhor compreensão, o código foi dividido em cinco partes:

  • Data Load:
    • Aqui, é criada a função load_data() para carregar os dados e apresentar suas primeiras informações, referentes à data de geração do DataFrame e atualizações do servidor da Agência Nacional de Energia Elétrica.
    • Também nesta seção as variáveis criadas são classificadas de acordo com sua tipologia e explicadas(Metadados).
  • Categorical Variables Analyses:

    • Estas análises foram fundamentais, uma vez que a grande maioria das variáveis deste DataFrame são categóricas.

    • Primeiro são verificados os valores únicos de cada variável categórica.

    • Estes valores são então analizados via diagrama aluvial, possibilitando uma hierarquização das variáveis.

  • DateTime Analyses:

    • Sabe-se que existem outliers nestes dados, uma vez que no processo de ETL valores nulos foram substituídos pelo ano "1900".

    • Por conta disso, filtram-se os dados que não contém outliers deste tipo.

    • Por fim, são realizadas análises temporais:

      • BOXPLOT: Linha do tempo - Tipo de Geração e Empreendimento.
      • HISTOGRAM: Linha do Tempo - Fase e Tipo de Geração.
      • HEATMAP: Linha do Tempo - Tipo de Geração e Potência Outorgada.
  • Categorical & Numerical Variables Analyses:

    • Análises Hierarquicas:

      • IcicleChart: Potência Outorgada por Fase, UF e tipo de Geração no Brasil.
      • SunBurstChart: Potência Outorgada por Fase, UF e tipo de Geração no Brasil.
      • TreeMapChart: Potência Outorgada por Fase, UF e tipo de Geração no Brasil.
    • Análises entre variáveis:

      • BarChart: Potência Outorgada por UF, Tipo de Geração e Fase.
      • StripChart:Potência Outorgada por UF, Tipo de Geração, Fase e Empreendimento.
      • 3D-ScatterPlot: Potência Outorgada e Garantia Física por UF, Tipo de Geração,Fase e Empreendimento.
        • Para esta Análise foram considerados apenas os empreendimentos com Garantia Física.
  • Geographical Variables Analyses:

    • Sabe-se que existem outliers nestes dados, uma vez que no processo de ETL valores nulos foram substituídos por 0.
    • Por conta disso, filtram-se os dados que não contém outliers deste tipo.
    • Mapa Iterativo de Coordenadas Cartesianas: Potência Outorgada, Tipo de Geração, Empreendimento e Fase.

O passo a passo detalhado é apresentado abaixo, em inglês.


In [1]:
# Library imports

##  Data Exploration & Vizualization libraries
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import plotly.express as px
import plotly as plt
import plotly.figure_factory as ff
import plotly.graph_objects as go

##  Web Scrapping library
import requests

# Functions
def linha(x):
    # Generates a Line with the input simbol

    print(x*50)

def load_data():
    # Function for loading data

    # Server request, dataframe generation and consolidation of DateTime variables
    patch = r"https://raw.githubusercontent.com/viniciusgribas/Analise_dados_geracao_BR/main/Analise_Geracao_II/Notebooks/output/CSV/Generation_Data.csv"

    response_API = requests.get(patch) 
    
    df = pd.read_csv(patch ,encoding='utf-8') 

    df.DatEntradaOperacao = pd.to_datetime(df.DatEntradaOperacao)
    df.DatInicioVigencia  = pd.to_datetime(df.DatInicioVigencia)
    df.DatFimVigencia = pd.to_datetime(df.DatFimVigencia)
    df.ETL_CreatedDataLoad_At = pd.to_datetime(df.ETL_CreatedDataLoad_At)
    df.ETL_DataBase_LastModified = pd.to_datetime(df.ETL_DataBase_LastModified)

    # Additional informations
    print('CREATION DATE [',df.ETL_CreatedDataLoad_At[1], ']') # Time this file was generated by the ETL
    print('LAST SERVER UPDATE ON DATA [',df.ETL_DataBase_LastModified[1],']') # Time the host last updated the file
    return (df)

# Personal Label
github = "_GitHub_@viniciusgribas"

Data Load¶

In [2]:
# Data Load
df = load_data()

#   VARIABLE CLASSIFICATION

#### Column                          Dtype             Variable Type       
## ---  ------                      -----              ----------             │ 
##  Empreendimento               │  object       │  CATEGORICAL-NOMINAL       │
##  UF                           │  object       │  CATEGORICAL-NOMINAL       │
##  TipoGeracao                  │  object       │  CATEGORICAL-NOMINAL       │
##  Fase                         │  object       │  CATEGORICAL-ORDINAL       │
##  OrigemCombustivel            │  object       │  CATEGORICAL-NOMINAL       │
##  FonteCombustivel             │  object       │  CATEGORICAL-NOMINAL       │
##  Outorga                      │  object       │  CATEGORICAL-ORDINAL       │
##  NomeCombustivel              │  object       │  CATEGORICAL-ORDINAL       │
##  DatEntradaOperacao           │  datetime64   │  CATEGORICAL-DATETIME      │
##  MdaPotenciaOutorgadaKW       │  float64      │  NUMERICAL-CONTINOUS-RATIO │
##  MdaPotenciaFiscalizadaKW     │  int64        │  NUMERICAL-DISCRETE        │
##  MdaGarantiaFisicaKW          │  float64      │  NUMERICAL-CONTINOUS-RATIO │
##  GeracaoQualificada           │  object       │  CATEGORICAL-BINARY        │
##  Y                            │  float64      │  NUMERICAL-CONTINOUS-INTERVAL*│ 
##  X                            │  float64      │  NUMERICAL-CONTINOUS-INTERVAL*│
##  DatInicioVigencia            │  datetime64   │  CATEGORICAL-DATETIME      │
##  DatFimVigencia               │  datetime64   │  CATEGORICAL-DATETIME      │
##  ETL_CreatedDataLoad_At       │  datetime64   │  CATEGORICAL-DATETIME      │
##  ETL_DataBase_LastModified    │  datetime64   │  CATEGORICAL-DATETIME      │

### *Geographical Variables
# ----------------------------------------------------------------------------------------------
# VARIABLE METADATA

# | Variable                 | Type        | Meaning                      |
# |--------------------------|-------------|------------------------------|
# | MdaGarantiaFisicaKW      | Numerical   | Physical Guarantee of Energy |
# | MdaPotenciaFiscalizadaKW | Numerical   | Supervised Electric Power    |
# | MdaPotenciaOutorgadaKW   | Numerical   | Granted Electric Power       |
# | Empreendimento           | Categorical | Business Name                |
# | UF                       | Categorical | Brasil States                |
# | TipoGeracao              | Categorical | Generation Type              |
# | Fase                     | Categorical | Operational Phase            |
# | OrigemCombustivel        | Categorical | Fuel Origin                  |
# | FonteCombustivel         | Categorical | Fuel Source                  |
# | NomeCombustivel          | Categorical | Fuel Name                    |
# | Outorga                  | Categorical | Grant                        |
# | GeracaoQualificada       | Categorical | Qualified Generation Mode    |
# | DatEntradaOperacao       | Date-Time   | Operation Start Date         |
# | DatInicioVigencia        | Date-Time   | Start Date of Contract       |
# | DatFimVigencia           | Date-Time   | End Date of Contract         |
# | X                        | Geographic  | Longitude Values             |
# | Y                        | Geographic  | Latitude Values              |
# │ ETL_CreatedDataLoad_At   │ Date-Time   | DataFrame creation date      |
# │ ETL_DataBase_LastModified│ Date-Time   | DataFrame Last Updated       |

# Analyze the columns names
df.info()
CREATION DATE [ 2022-04-24 03:03:46 ]
LAST SERVER UPDATE ON DATA [ 2022-04-19 20:13:45 ]
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 15469 entries, 0 to 15468
Data columns (total 19 columns):
 #   Column                     Non-Null Count  Dtype         
---  ------                     --------------  -----         
 0   Empreendimento             15469 non-null  object        
 1   UF                         15469 non-null  object        
 2   TipoGeracao                15469 non-null  object        
 3   Fase                       15469 non-null  object        
 4   OrigemCombustivel          15469 non-null  object        
 5   FonteCombustivel           15469 non-null  object        
 6   Outorga                    15469 non-null  object        
 7   NomeCombustivel            15469 non-null  object        
 8   DatEntradaOperacao         15469 non-null  datetime64[ns]
 9   MdaPotenciaOutorgadaKW     15469 non-null  float64       
 10  MdaPotenciaFiscalizadaKW   15469 non-null  int64         
 11  MdaGarantiaFisicaKW        15469 non-null  float64       
 12  GeracaoQualificada         15469 non-null  object        
 13  Y                          15469 non-null  float64       
 14  X                          15469 non-null  float64       
 15  DatInicioVigencia          15469 non-null  datetime64[ns]
 16  DatFimVigencia             15469 non-null  datetime64[ns]
 17  ETL_CreatedDataLoad_At     15469 non-null  datetime64[ns]
 18  ETL_DataBase_LastModified  15469 non-null  datetime64[ns]
dtypes: datetime64[ns](5), float64(4), int64(1), object(9)
memory usage: 2.2+ MB

Categorical Variables Analyses¶

In [3]:
# Considering that most variables in this DataFrame are categorical, it is important to hierarchize them, making it more intuitive.

# Unique Values Analyses.
print(df.select_dtypes(['object']).nunique().sort_values())
linha('*')
print('GeracaoQualificada - Unique',df.GeracaoQualificada.unique())
linha('-')
print('Fase - Unique',df.Fase.unique())
linha('-')
print('Outorga - Unique',df.Outorga.unique())
linha('-')
print('OrigemCombustivel - Unique',df.OrigemCombustivel.unique())
linha('-')
print('TipoGeracao - Unique',df.TipoGeracao.unique())
linha('-')
print('FonteCombustivel - Unique',df.FonteCombustivel.unique())
linha('-')
print('UF - Unique',df.UF.unique())
linha('-')
print('NomeCombustivel - Unique',df.NomeCombustivel.unique())

# By the number of unique values, a possible hierarchical order is:
# 'GeracaoQualificada' > 'Fase' > 'Outorga' > OrigemCombustivel > TipoGeracao > FonteCombustivel > UF 
GeracaoQualificada        2
Fase                      3
Outorga                   3
OrigemCombustivel         7
TipoGeracao               8
FonteCombustivel         14
UF                       27
NomeCombustivel          32
Empreendimento        15207
dtype: int64
**************************************************
GeracaoQualificada - Unique ['Não' 'Sim']
--------------------------------------------------
Fase - Unique ['Operação' 'Construção não iniciada' 'Construção']
--------------------------------------------------
Outorga - Unique ['Autorização' 'Concessão' 'Registro']
--------------------------------------------------
OrigemCombustivel - Unique ['Hídrica' 'Fóssil' 'Biomassa' 'Nuclear' 'Eólica' 'Solar' 'Undi-Elétrica']
--------------------------------------------------
TipoGeracao - Unique ['PCH' 'UHE' 'CGH' 'UTE' 'UTN' 'EOL' 'UFV' 'CGU']
--------------------------------------------------
FonteCombustivel - Unique ['Potencial hidráulico' 'Carvão mineral' 'Petróleo' 'Agroindustriais'
 'Gás natural' 'Urânio' 'Floresta' 'Resíduos sólidos urbanos'
 'Cinética do vento' 'Radiação solar' 'Outros Fósseis' 'Cinética da água'
 'Resíduos animais' 'Biocombustíveis líquidos']
--------------------------------------------------
UF - Unique ['MG' 'RS' 'SC' 'TO' 'RR' 'MT' 'SP' 'ES' 'RO' 'AM' 'AP' 'RJ' 'PR' 'CE'
 'BA' 'PA' 'MA' 'PI' 'AL' 'GO' 'PB' 'MS' 'PE' 'DF' 'SE' 'RN' 'AC']
--------------------------------------------------
NomeCombustivel - Unique ['Potencial hidráulico' 'Gás de Alto Forno - CM' 'Óleo Diesel'
 'Bagaço de Cana de Açúcar' 'Gás Natural' 'Urânio' 'Licor Negro'
 'Óleo Combustível' 'Calor de Processo - CM'
 'Outros Energéticos de Petróleo' 'Carvão Mineral' 'Resíduos Florestais'
 'Calor de Processo - GN' 'Gás de Refinaria' 'Biogás - RU'
 'Cinética do vento' 'Lenha' 'Casca de Arroz' 'Radiação solar'
 'Carvão Vegetal' 'Gás de Alto Forno - PE' 'Gás de Alto Forno - Biomassa'
 'Calor de Processo - OF' 'Cinética da água' 'Biogás - RA'
 'Capim Elefante' 'Óleos vegetais' 'Biogás-AGR'
 'Resíduos Sólidos Urbanos - RU' 'Biogás - Floresta' 'Etanol'
 'Carvão - RU']
In [4]:
# Visualizing the relationship and variables hierarchy.

fig = px.parallel_categories(df,
dimensions  = ['GeracaoQualificada','Fase','Outorga','OrigemCombustivel','TipoGeracao','FonteCombustivel','NomeCombustivel'],
labels ={'GeracaoQualificada','Fase','Outorga','OrigemCombustivel','TipoGeracao','FonteCombustivel','NomeCombustivel'}
)

# UF - [Not used in this view]
# GeracaoQualificada
# Fase
# Outorga
# OrigemCombustivel
# TipoGeracao
# FonteCombustivel
# NomeCombustivel


fig.show()
NãoGeracaoQualificadaSimOperaçãoFaseConstrução não iniciadaConstruçãoAutorizaçãoOutorgaConcessãoRegistroHídricaOrigemCombustivelFóssilBiomassaNuclearEólicaSolarUndi-ElétricaPCHTipoGeracaoUHECGHUTEUTNEOLUFVCGUPotencial hidráulicoFonteCombustivelCarvão mineralPetróleoAgroindustriaisGás naturalUrânioFlorestaResíduos sólidos urbanosCinética do ventoRadiação solarOutros FósseisCinética da águaResíduos animaisBiocombustíveis líquidosPotencial hidráulicoNomeCombustivelGás de Alto Forno - CMÓleo DieselBagaço de Cana de AçúcarGás NaturalUrânioLicor NegroÓleo CombustívelCalor de Processo - CMOutros Energéticos de PetróleoCarvão MineralResíduos FlorestaisCalor de Processo - GNGás de RefinariaBiogás - RUCinética do ventoLenhaCasca de ArrozRadiação solarCarvão VegetalGás de Alto Forno - PEGás de Alto Forno - BiomassaCalor de Processo - OFCinética da águaBiogás - RACapim ElefanteÓleos vegetaisBiogás-AGRResíduos Sólidos Urbanos - RUBiogás - FlorestaEtanolCarvão - RU
plotly-logomark

DateTime Analyses¶

In [5]:
# There are outliers in the year 1900
# To analyze variables with dates, two new variables are created:
## 'df_data' and 'df_data_op' without outliers.

df_data = df.get(df['DatInicioVigencia']>'1901')
df_data = df.get(df['DatFimVigencia']>'1901')
df_data_op = df.get(df['DatEntradaOperacao']>'1901')

BOXPLOT: Timeline - Type of Generation and Business¶

In [6]:
fig = px.box(df_data,
    title='DatInicioVigencia',
    x='TipoGeracao',
    y="DatInicioVigencia",
    hover_name='Empreendimento',
    color='TipoGeracao',
    points="all")
fig.show()

fig = px.box(df_data,
    title='DatFimVigencia',
    x='TipoGeracao',
    color='TipoGeracao',
    y="DatFimVigencia",
    hover_name='Empreendimento',
    points="all")
fig.show()

fig = px.box(df_data_op,
title='DatEntradaOperacao',
x='TipoGeracao',
color='TipoGeracao',
y="DatEntradaOperacao",
hover_name='Empreendimento',
points="all")
fig.show()
PCHUHEUTECGHEOLUFV197019801990200020102020
TipoGeracaoPCHUHEUTECGHEOLUFVDatInicioVigenciaTipoGeracaoDatInicioVigencia
plotly-logomark
PCHUHEUTECGHEOLUFV19902000201020202030204020502060
TipoGeracaoPCHUHEUTECGHEOLUFVDatFimVigenciaTipoGeracaoDatFimVigencia
plotly-logomark
PCHUHECGHUTEUTNEOLUFV1900192019401960198020002020
TipoGeracaoPCHUHECGHUTEUTNEOLUFVDatEntradaOperacaoTipoGeracaoDatEntradaOperacao
plotly-logomark

HISTOGRAM: Timeline - Phase and Type of Generation¶

In [7]:
fig = px.histogram(df_data,
    title='DatInicioVigencia',
    x="DatInicioVigencia",
    marginal='violin',
    color = 'Fase',
    barmode='group',
    animation_frame='TipoGeracao',
    labels='TipoGeracao',
    range_y = (0,300),
 )
fig.show()

fig = px.histogram(df_data,
    title='DatFimVigencia',
    x="DatFimVigencia",
    marginal='violin',
    color = 'Fase',
    barmode='group',
    animation_frame='TipoGeracao',
    labels='TipoGeracao',
    range_y = (0,300),
 )

fig.show()
fig = px.histogram(df_data_op,
    title='DatEntradaOperacao',
    x="DatEntradaOperacao",
    marginal='violin',
    color = 'Fase',
    barmode='group',
    animation_frame='TipoGeracao',
    labels='TipoGeracao',
    range_y = (0,300),
 )
fig.show()
199020002010202020300100200300
FaseOperaçãoConstrução não iniciadaConstruçãoTipoGeracao=PCHPCHUHEUTECGHEOLUFVDatInicioVigenciaDatInicioVigenciacount▶◼
plotly-logomark
2010202020302040205020600100200300
FaseOperaçãoConstrução não iniciadaConstruçãoTipoGeracao=PCHPCHUHEUTECGHEOLUFVDatFimVigenciaDatFimVigenciacount▶◼
plotly-logomark
1920194019601980200020200100200300
FaseOperaçãoTipoGeracao=PCHPCHUHECGHUTEUTNEOLUFVDatEntradaOperacaoDatEntradaOperacaocount▶◼
plotly-logomark

HEATMAP: Timeline - Type of Generation and Granted Power¶

In [8]:
fig_dens = px.density_heatmap(df_data, 
 title='Timeline - GrantedPower - DatInicioVigencia',                
 x="DatInicioVigencia",                               
 y="TipoGeracao",                     
 z= "MdaPotenciaOutorgadaKW" ,         
 marginal_x="histogram",              
 marginal_y="histogram",               
 text_auto=True                        
)
fig_dens.show()

fig_dens = px.density_heatmap(df_data, 
 title='Timeline - GrantedPower - DatFimVigencia',                
 x="DatFimVigencia",                               
 y="TipoGeracao",                     
 z= "MdaPotenciaOutorgadaKW" ,         
 marginal_x="histogram",              
 marginal_y="histogram",               
 text_auto=True                        
)
fig_dens.show()

fig_dens = px.density_heatmap(df_data_op, 
 title='Timeline - GrantedPower - DatEntradaOperacao',                
 x="DatEntradaOperacao",                               
 y="TipoGeracao",                     
 z= "MdaPotenciaOutorgadaKW" ,         
 marginal_x="histogram",              
 marginal_y="histogram",               
 text_auto=True                        
)
fig_dens.show()
00000000000029.232k60.99k43.057k220.55k52.515k527.987k1.223914M579.9842k470.112k848.236k704.014k443.208k376.545k742.725k527.5672k349.0017k15.52k002.082M7M0249.75k17k12k0024.96k013.8k133.5k1.946568M3.209777M10.08902M6.165768M2.681132M1.757M1.669457M8.81125M15.23885M15.98623M1.773837M19.44901M3.8727M87.02k1.184298M2000000020.3k225.1k74.4k30.33k11.688k10.946k066.781k1.758555M1.277274M2.300478M7.62312M3.492467M2.000572M3.835067M7.956625M2.050496M2.863452M4.734069M2.208784M4.299656M4.294337M204.624k00550000000736000450190000000004400018.9k16.612k17.031k000000000000000002500297.35k649.63k284.7k081.3k3.945105M2.96421M5.805755M1.63645M6.934785M10.9649M1.3805M000000000000000000000000820.219k1.74674M7.504224M24.89367M8.1388M197019801990200020102020PCHUHEUTECGHEOLUFV
05M10M15M20Msum of MdaPotenciaOutorgadaKWTimeline - GrantedPower - DatInicioVigenciaDatInicioVigenciaTipoGeracao
plotly-logomark
00000015k105.322k439.982k2.021377M1.525473M1.385012M546.7791k870.7551k305.4577k000017k12k255.66k19.07616M12.52439M8.617892M8.520014M26.78104M24.2766M1.78418M1.589998M9164023.95k529.2k20.3k370.63k1.46148M558.602k3.821528M11.80746M3.710382M12.89001M2.806667M9.091476M4.238472M000550073606400004400035.512k17.031k00000013.5k045.7k1.13268M158.3k1.00222M10.49348M9.88286M12.21844M000000050k030k48k235.665k58.429k9.81509M32.86647M19902000201020202030204020502060PCHUHEUTECGHEOLUFV
05M10M15M20M25M30Msum of MdaPotenciaOutorgadaKWTimeline - GrantedPower - DatFimVigenciaDatFimVigenciaTipoGeracao
plotly-logomark
0016.854k11.8k010.58k18k8608096.37k43.5k67.832k43.915k014.1k031.944k6,589.1746.255k33.6k444.403k1.696383M1.58726M867.5341k321.004k046.4k66.793k4000187.969k954.5k19.08k0135.188k39k482.85k1.53442M2.974693M3.021027M7.2011M10.14583M16.3449M9.40313M6.28715M5.60565M6.270381M4.933923M12.11319M15.14202M002,718.438,185.910.0704k4,510.415.2575k2700681124.659k15.3377k38.66339k15.6324k22.3484k16.272k15.16566k16.53069k23.12048k22.27296k20.75572k19.32147k32.93841k82.56696k146.5712k208.004k42.617k70414k00000050k0435k53.643k133.25k1.294822M399.034k1.269402M741.4844k409.3408k938.9125k1.429416M11.14815M5.655915M12.646M4.206902M4.851616M00000000000000000640k001.35M0000000000000000000000075005400579.1525k4.420405M10.39534M6.20321M000000000000501502300035.7449.0615.18767k2.474699M2.53272M1900192019401960198020002020PCHUHECGHUTEUTNEOLUFV
02M4M6M8M10M12M14M16Msum of MdaPotenciaOutorgadaKWTimeline - GrantedPower - DatEntradaOperacaoDatEntradaOperacaoTipoGeracao
plotly-logomark

Categorical & Numerical Variables Analyses¶

In [9]:
round(df.describe(),2)
Out[9]:
MdaPotenciaOutorgadaKW MdaPotenciaFiscalizadaKW MdaGarantiaFisicaKW Y X
count 15469.00 15469.00 15469.00 15469.00 15469.00
mean 15986.58 11826.26 5979.22 -8.16 -38.24
std 156839.41 155249.73 96488.49 9.25 20.72
min 0.16 0.00 0.00 -33.72 -72.81
25% 1.00 1.00 0.00 -15.82 -52.26
50% 1.38 1.00 0.00 -3.78 -48.15
75% 4000.00 720.00 0.00 -1.74 -36.75
max 11233100.00 11233100.00 7772900.00 4.89 0.00

Hierarchy Analysis¶

Granted Power by Phase, Type of Generation and States in Brazil¶

In [10]:
size = 750

fig_IcicleChart = px.icicle(df, 
    path=[px.Constant('BRASIL'),
        'Fase',
        "UF",
        'TipoGeracao'],
    values='MdaPotenciaOutorgadaKW',
    title= title_IcicleChart,
    width=size,
    height=size*2,
    maxdepth = -1  )

fig_IcicleChart.update_traces(root_color="lightgrey")
fig_IcicleChart.update_layout(margin = dict(t=50, l=50, r=50, b=50))
fig_IcicleChart.show()

# plt.offline.plot(fig_IcicleChart, filename = title_IcicleChart_export)
There was an error when executing cell [10]. Please run Voilà with --show_tracebacks=True or --debug to see the error message, or configure VoilaConfiguration.show_tracebacks.